<? require_once "hotel.php" ?>
<? require_once 'head.html' ?>
<? $rooms = Hotel::getRooms() ?>

<h1> Rooms: </h1>

Rooms count: <?= count($rooms) ?>
<form name="myform" action="hotelbook" method="POST">
<table>
  <tr><th>Type</th><th>Available</th><th>Price</th><th></th></tr>
  <? foreach ($rooms as $room) { ?> 
    <tr><td><?=$room["id"]?>.</td><td><?=$room["free"]?></td><td><?=$room["price"]?>&euro;</td><td><input type="radio" name="type" value="<?=$room["id"]?>"> </td></tr>
  <? } ?>
</table>
<p>
<label for="lastname">Name:</label>
<input type="text" name="lastname"> </input>
<p>
<input type="submit" value="Book"> </input>
</form>
<? require 'tail.html' ?>
